<template>
<div>
  <div class="quan">
<div class="sousu">
<span @click="tiao"><van-icon name="arrow-left" @click="zhuan"/>上海</span><van-icon name="arrow-down" />&nbsp;&nbsp;&nbsp;|

<span class="ziti">
  <van-icon name="search" class="search"/>请输入小区或地址</span>
</div>
<van-icon name="thumb-circle-o" class="aaaa" />
  </div>
<van-tabs >
  <van-tab title="区域" name="a"><van-area
  title="标题"

  :columns-placeholder="['请选择', '请选择', '请选择']"

/></van-tab>
  <van-tab title="方式" name="b">
    <van-dropdown-menu>
  <van-dropdown-item   get-container="body" />
  <van-dropdown-item  ref="item" get-container="body">
    <van-cell center title="不限">
      <template >
        <!-- <van-switch v-model="switch1" size="24" active-color="#ee0a24" /> -->
      </template>
    </van-cell>
    <van-cell center title="整租">
      <template>
        <!-- <van-switch v-model="switch2" size="24" active-color="#ee0a24" /> -->
      </template>
    </van-cell>
    <van-cell center title="合租">
      <template >
        <!-- <van-switch v-model="switch3" size="24" active-color="#ee0a24" /> -->
      </template>
    </van-cell>
    <div style="padding: 5px 16px;">
      <van-button type="danger" block round @click="onConfirm">
        确认
      </van-button>
    </div>
  </van-dropdown-item>
</van-dropdown-menu>
  </van-tab>
  <van-tab title="标签 3" name="c">
     <!-- <van-dropdown-menu>
  <van-dropdown-item   />
  <van-dropdown-item  ref="item">
    <van-cell center title="不限">
      <template #right-icon>
        <van-switch v-model="switch1" size="24" active-color="#ee0a24" />
      </template>
    </van-cell>
    <van-cell center title="整租">
      <template #right-icon>
        <van-switch v-model="switch2" size="24" active-color="#ee0a24" />
      </template>
    </van-cell>
    <van-cell center title="合租">
      <template #right-icon>
        <van-switch v-model="switch3" size="24" active-color="#ee0a24" />
      </template>
    </van-cell>
    <div style="padding: 5px 16px;">
      <van-button type="danger" block round @click="onConfirm">
        确认 -->
      <!-- </van-button> -->
    <!-- </div> -->
  <!-- </van-dropdown-item> -->
<!-- </van-dropdown-menu> -->
  </van-tab>
  <van-tab title="标签 4" name="d">内容 4</van-tab>
</van-tabs>

  </div>
</template>

<script>
import { getHouses, getCityValue } from '@/api/user'
export default {
  // data () {
  //   return {

  //     // activeName: 'a',
  //     switch1: false,
  //     switch2: false,
  //     switch3: false,
  //     areaList: {
  //       province_list: {
  //         110000: this.body.value

  //       },
  //       city_list: {
  //         110100: '北京市'

  //       },
  //       county_list: {
  //         110101: '东城区'

  //         // ....
  //       }
  //     }
  //   }
  // },
  async created () {
    console.log(localStorage.getItem('cityname'))
    const { body } = await getCityValue({
      name: localStorage.getItem('cityname')
    })
    console.log(body)
    const res = await getHouses({
      id: body.value
    })
    // this.id=id,
    // this.area=area

    console.log(res)
  },
  methods: {
    tiao () {
      this.$router.push('/citylist')
    },
    zhuan () {
      this.$router.back()
    },
    onConfirm () {
      this.$refs.item.toggle()
    }

  }
}
</script>

<style>
.quan{
  width: 100%;
  height: 50px;
  background-color: rgb(33, 185, 122);
}
.sousu{
    position: fixed;
    top: 15px;
    left: 20px;
   width: 100%;
   height: 30px;
   margin-right: 50px;
   height: 30px;
   background-color:#fff;
   line-height: 30px;

  }
  .sousuo span{
    font-size: 14px;
  }
  .aaaa{
      position: fixed;
      top: 20px;
      right: 10px;
      font-size: 25px;
    }

</style>
